package com.ruoyi.commodity.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * 自定义质检项表
 * @TableName tb_product_custom_quality_item
 */
@TableName(value ="tb_product_custom_quality_item")
@Data
public class ProductCustomQualityItem implements Serializable {
    /**
     * 自定义质检项ID
     */
    @TableId(value = "custom_item_id", type = IdType.AUTO)
    private Long customItemId;

    /**
     * 产品ID
     */
    @TableField(value = "product_id")
    private Integer productId;

    /**
     * 质检项名称
     */

    @JsonProperty("checkItem")
    @TableField(value = "inspection_item")
    private String inspectionItem;

    /**
     * 质检内容
     */
    @JsonProperty("checkContent")
    @TableField(value = "inspection_content")
    private String inspectionContent;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at")
    private Date updatedAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductCustomQualityItem other = (ProductCustomQualityItem) that;
        return (this.getCustomItemId() == null ? other.getCustomItemId() == null : this.getCustomItemId().equals(other.getCustomItemId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getInspectionItem() == null ? other.getInspectionItem() == null : this.getInspectionItem().equals(other.getInspectionItem()))
            && (this.getInspectionContent() == null ? other.getInspectionContent() == null : this.getInspectionContent().equals(other.getInspectionContent()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCustomItemId() == null) ? 0 : getCustomItemId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getInspectionItem() == null) ? 0 : getInspectionItem().hashCode());
        result = prime * result + ((getInspectionContent() == null) ? 0 : getInspectionContent().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", customItemId=").append(customItemId);
        sb.append(", productId=").append(productId);
        sb.append(", inspectionItem=").append(inspectionItem);
        sb.append(", inspectionContent=").append(inspectionContent);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}